<div class="box-body" style="display: block;">
    <form method="POST" action="/xqc/overseas-in/os-marks-create-upload" class="form-horizontal" accept-charset="UTF-8" enctype="multipart/form-data">
        <div class="box-body fields-group">
            <div class="form-group">
                <label class="col-sm-3 control-label"></label>
                <div class="col-sm-5">
                    <label style="padding-top: 8px;" for="delivery_no" class="col-sm-3 control-label">发货单号</label>
                    <div class="col-sm-8">
                        <input type="text" style="width: 180px;" name="delivery_no" placeholder="发货单号" required>
                    </div>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label"></label>
                <div class="col-sm-5">
                    <label style="padding-top: 8px;" for="template_1" class="col-sm-3 control-label">箱唛模板</label>
                    <div class="col-sm-8">
                        <select id="template_1" name="template" required>
                            {{ getOptions(\App\Models\OverSeasIn\MarksPDF::$_template) }}
                        </select>
                    </div>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label"></label>
                <div class="col-sm-5">
                    <label style="padding-top: 8px;" for="download" class="col-sm-3 control-label">EXCEL模版</label>
                    <div class="col-sm-8">
                        <button class="btn btn-sm btn-info" id="download"><i class="fa fa-download"></i>&nbsp;&nbsp;下载模版</button>
                    </div>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label"></label>
                <div class="col-sm-5">
                    <label style="padding-top: 8px;" class="col-sm-3 control-label">文件</label>
                    <div class="col-sm-8">
                        <input type="file" style="margin-top: 4px;" name="source_file" accept=".xlsx,.xls" required>
                        <span class="help-block"><i class="fa fa-info-circle"></i>&nbsp;文件后缀为.xlsx或.xls</span>
                    </div>
                </div>
            </div>
            @include('layouts.upload.help')
        </div>
        <div class="box-footer">
            <div class="col-md-3"></div>
            <div class="col-md-5" style="text-align: center;">
                <div class="btn-group">
                    {{ csrf_field() }}
                    <button type="submit" class="btn btn-info">生成箱唛</button>
                </div>
            </div>
        </div>
    </form>
</div>
<script language="JavaScript" type="text/javascript">
    $(function () {
        $('#template_1').select2({placeholder: '箱唛模板', allowClear: true, width: '180px'});
        $('#download').on('click', function (e) {
            e.preventDefault();
            var template = $('#template_1').val();
            if(template == ''){
                swal('请先选择箱唛模板', '', 'error');
                return false;
            }
            window.location.href = "/xqc/overseas-in/os-marks-create-template?temp=OS_MARKS_"+template;
        });
    });
</script>
